{% extends "wltheme/base_detail.html" %}
{% load future wenlincms_tags comment_tags wlcore_tags %}

{% block breadcrumb_menu %}
    <div class="am-container">
        <ol class="am-breadcrumb">
            <li><a href="/" class="am-icon-home">{{ sitesettings.title }}</a></li>
            <li><a href="/zhi">官方资讯</a></li>
            {% with the_post.categories.all as categories %}
                {% if categories %}
                    {% for category in categories %}
                        {% if forloop.first %}
                            <li><a href="{% url "article_post_list_category" category.slug %}">{{ category }}</a></li>
                        {% endif %}
                    {% endfor %}
                {% endif %}
            {% endwith %}
            <li><a>{{ the_post.title }}</a></li>
        </ol>
    </div>
    {#下面加一个分割行占位#}
    <div class="wl-container" style="padding: 6px 0;box-shadow: none"></div>
{% endblock %}

{% block main %}
    <div class="am-u-md-10">
        <div class="wl-container white-back wl-zhi-detail-head">
            <h2>{{ the_post.title }}</h2>
        </div>

        <div class="wl-container white-back">
            {% include "wltheme/includes/baidushare.html" %}

            <div class="wl-zhi-detail">
                <div class="list-footer-meta">
                    <i class="am-icon-bookmark-o moveicon-6"></i>发布：{{ the_post.created|date:"Y-m-j" }}
                    {% nevercache %}{% spaceless %}
                        {% load wlcore_tags %}&nbsp;&nbsp;&nbsp;
                        <i class="am-icon-eye-slash moveicon-6"></i>浏览：
                        {% show_views request.META.PATH_INFO "article.articlepost" as view_count %}{{ view_count }}
                    {% endspaceless %}{% endnevercache %}
                    {% if the_post.allow_comments %}&nbsp;&nbsp;&nbsp;
                        <i class="am-icon-comments-o moveicon-6"></i>评论：
                        <a href="{{ the_post.get_absolute_url }}#comments">
                            {{ the_post.comments_count }}
                        </a>
                    {% endif %}
                    {% with the_post.categories.all as categories %}
                        {% if categories %}&nbsp;&nbsp;&nbsp;
                            <i class="am-icon-bars moveicon-6"></i>类别：
                            {% for category in categories %}
                                <a href="{% url "article_post_list_category" category.slug %}"
                                   class="wl-taglink">{{ category }}</a>
                                {% if not forloop.last %}, {% endif %}
                            {% endfor %}
                        {% endif %}
                    {% endwith %}
                </div>

                <div class="content">
                    {{ the_post.content|richtext_filters|safe }}
                </div>

                {% if the_post.allow_comments %}
                    <div class="wl-container white-back detail-comments">
                        <div data-am-widget="titlebar" class="am-titlebar am-titlebar-default">
                            <h2 class="am-titlebar-title wl-titlebar-title">会员评论</h2>
                                <span>共 <f class="am-badge am-badge-success">{{ the_post.comments_count }}</f>
                                条评论
                                </span>
                        </div>
                        {% wlcomments_for the_post %}
                    </div>
                {% endif %}

            </div>
        </div>
    </div>
{% endblock %}

{% block left_panel %}
    {% include "wltheme/article/side_panel.html" %}
{% endblock %}

{% block js %}
    {{ block.super }}
    {# 百度分享相关 #}
    {{ sitesettings.share|safe }}
{% endblock %}
